import os
import urllib

base_dir = os.path.abspath(os.path.dirname(__file__))

googlecode_url = "http://singsong.googlecode.com/files/"
DEPS = [["jcommon.jar", googlecode_url + "jcommon-1.0.16.jar"],
        ["jfreechart.jar", googlecode_url + "jfreechart-1.0.13.jar"]]

for (name, url) in DEPS:
  print "Grabbing", name, "from", url, "..."
  local_file = os.path.join(base_dir, name)
  try:
    urllib.urlretrieve(url, local_file)
  except error:
    print error